package org.jctc.els.modules.biz.entity.user;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @author lyh
 * @since 2021-02-26
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("cmf_user")
@ApiModel(value="User对象", description="用户表")
public class User extends BaseEntity {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty("主键id")
	@TableId(value = "id",type = IdType.ASSIGN_ID)
	private Long id;

    private String userName;

    private String password;

    private String account;

	@ApiModelProperty("用户状态")
	private Integer status;

	@ApiModelProperty(value = "基本角色   0：无角色  1：超级管理员  2：专家")
	private Long baseRole;

	@ApiModelProperty(value = "盐")
	private String salt;

	@ApiModelProperty(value = "手机号码")
	private String mobile;

	@ApiModelProperty(value = "手机验证状态 1：已通过  0：未通过")
	private Integer mobileStatus;

	@ApiModelProperty(value = "最后登录时间")
	private Date logged;

	@ApiModelProperty(value = "头像")
	private String avatar;

	@ApiModelProperty(value = "性别")
	private Integer gender;

	@ApiModelProperty(value = "生日")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	private Date birthday;

	@ApiModelProperty("租户ID")
	private String tenantId;

	@ApiModelProperty("email")
	private String email;

	@ApiModelProperty("角色ID")
	private String roleId;

	@ApiModelProperty("部门ID")
	private String deptId;

	@ApiModelProperty("创建部门ID")
	private Long createDeptId;

	@JsonSerialize(using = ToStringSerializer.class)
	@ApiModelProperty("创建人")
	private Long createdBy;

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty("创建时间")
	private Date createdTime;

	@JsonSerialize(using = ToStringSerializer.class)
	@ApiModelProperty("更新人")
	private Long updatedBy;

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty("更新时间")
	private Date updatedTime;

	@ApiModelProperty("第三方认证ID")
	private String oauthId;

	@ApiModelProperty("岗位ID")
	private String postId;

	/**
	 * 是否组长;0->否 1->是
	 */
	@ApiModelProperty("是否组长;0->否 1->是")
	@TableField(exist = false)
	private Integer canLeader;

}
